Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-transformer-remark): use subplugin annotation to use automatic subplugin module loading #33039

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Sep 3, 2021

Depend on #33030

Description

This moves gatsby-transformer-remark away from requiring arbitrary modules inside plugin and instead relying on subPlugins helper to automatically load those modules.

Same as #33040 - just for gatsby-plugin-mdx package

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 3, 2021
@pieh pieh marked this pull request as ready for review September 6, 2021 11:55
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LekoArts LekoArts added topic: remark/mdx Related to Markdown, remark & MDX ecosystem and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Sep 6, 2021
Comment on lines +43 to +44
const resolvedPlugin =
_CFLAGS_.GATSBY_MAJOR === `4` ? plugin.module : require(plugin.resolve)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the old behavior will be incompatible with v4 and will be a breaking change? Did we consider keeping it compatible? I am fine with both but if it will be a breaking change we should probably add a note in #32860

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require(plugin.resolve) will continue to work in V4, but it will be undesirable to use it due to bundling problems with dynamic imports and using .subPlugins will be recomended. Not sure if there is nice way to "deprecate" old style here

@vladar vladar added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Sep 7, 2021
@gatsbybot gatsbybot merged commit 3260b1a into master Sep 7, 2021
@gatsbybot gatsbybot deleted the feat/4-remark-subplugin branch September 7, 2021 16:55
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: remark/mdx Related to Markdown, remark & MDX ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants